package net.jgrm.common.util;

import java.util.List;

/**
 * 分页数据包装类
 *
 * @param <T> 数据类型
 * @author service-common
 */
public class PagingData<T> {

    /**
     * 数据列表
     */
    private List<T> list;

    /**
     * 分页信息
     */
    private Paging paging;

    /**
     * 默认构造函数
     */
    public PagingData() {
    }

    /**
     * 构造函数
     *
     * @param list   数据列表
     * @param paging 分页信息
     */
    public PagingData(List<T> list, Paging paging) {
        this.list = list;
        this.paging = paging;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public Paging getPaging() {
        return paging;
    }

    public void setPaging(Paging paging) {
        this.paging = paging;
    }

    @Override
    public String toString() {
        return "PagingData{" +
                "listSize=" + (list != null ? list.size() : 0) +
                ", paging=" + paging +
                '}';
    }
}